using System;
using System.Collections.Generic;
using NUnit.Framework;
using Tao.OpenGl;
using AffineMatrixF = NPack.AffineMatrix<NPack.SingleComponent>;
using VectorF = NPack.Vector<NPack.SingleComponent>;
using IVectorF = NPack.Interfaces.IVector<NPack.SingleComponent>;

namespace NPack.Tests.OpenGL
{
    [TestFixture]
    public class OpenGLAffineTransformTests
    {
        private static readonly Single _e = 0.0001F;

        [Test]
        public void RotationTest()
        {
            Gl.glLoadIdentity();
            Gl.glRotatef((Single)Math.PI / 4, 1, 0, 0);
            Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY);
            //Gl.glVertexPointervINTEL(2, Gl.GL_FLOAT, );
            AffineMatrixF a1 = new AffineMatrixF(MatrixFormat.ColumnMajor, 4);
            a1.RotateAlong(new VectorF(1, 0, 0), Math.PI / 4);

            VectorF[] npackPoints = new VectorF[]
                {
                    new VectorF(1, 0, 0, 1), 
                    new VectorF(0, 1, 0, 1), 
                    new VectorF(0, 0, 1, 1),
                };
            List<IVectorF> npackResults = new List<IVectorF>();
            npackResults.AddRange(a1.TransformVectors(npackPoints));

            //Gl.glGetPointerv(Gl.GL_VERTEX_ARRAY_POINTER);
        }
    }
}
